<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.pollix.at/thymeleaf/shiro">
<head th:replace="admin/common/html/head :: head(~{::title},~{::link},~{::style})">

    <title th:text=${title}></title>
    <!-- 这儿引用单独的css link -->
    <link rel="stylesheet" th:href="@{static/admin/assets/js/button/ladda/ladda.min.css}">
    <link th:href="@{/static/admin/assets/js/bootstrap/css/bootstrap-table/bootstrap-table.min.css}" rel="stylesheet"/>

    <style type="text/css">
        /**
        *这里写单独的css样式
        */
    </style>

</head>

<body>
<!-- 右边内容 -->
<div class="wrap-fluid">
    <div class="container-fluid paper-wrap bevel tlbr">
        <!-- 内容 -->
        <div class="content-wrap">
            <!-- 结束内容 -->
            <div class="row">
                <div class="col-sm-12">
                    <!-- 空白页开始-->
                    <div class="nest" id="Blank_PageClose">
                        <div class="title-alt">
                            <h1 style="text-align: center">订单查询</h1>
                        </div>

                        <div class="body-nest" id="search_div">
                            <div class="form_left">
                                <form role="form" class="form-inline">
                                    <div class="form-group" style="width: 85%;">
                                        <label for="searchTxt" class="sr-only">收钱金额</label>
                                        <input type="text" name="searchTxt" id="searchTxt" placeholder="收钱金额" class="form-control"
                                               style="padding: 23px;width: 100%;">
                                    </div>
                                    <button onclick="$.table.search(this)" class="btn btn-success" type="button"
                                            style="height: 48px;width: 100px;">
                                        <i class="fa fa-search"></i>&nbsp;搜索
                                    </button>
                                </form>
                            </div>
                        </div>

                        <div class="body-nest" id="Blank_Page_Content">
                            <table id="dataTable" class="table-bordered metro-blue" data-page-size="6">
                            </table>
                        </div>
                    </div>
                </div>
                <!-- 空白页结束 -->
            </div>
            <!-- 结束内容 -->
            <!-- 页脚 通用-->
            <div th:replace="admin/common/html/footer :: footer">
            </div>
            <!-- 结束页脚通用 -->
        </div>
    </div>
</div>
<!-- 结束右边内容 -->

<!-- 通用js -->
<!-- 通用js -->
<div th:include="admin/common/html/js :: onload_js">

</div>
<!-- bootstarp 表格 -->
<script th:src="@{/static/admin/assets/js/bootstrap/js/bootstrap-table/bootstrap-table.min.js}"
        type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/js/bootstrap-table/locale/bootstrap-table-zh-CN.min.js}"
        type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/js/base_list.js}" type="text/javascript"></script>
<!-- 导出 -->
<script th:src="@{/static/admin/assets/js/bootstrap/extensions/export/bootstrap-table-export.js}"
        type="text/javascript"></script>
<script th:src="@{/static/admin/assets/js/bootstrap/extensions/export/tableExport.js}" type="text/javascript"></script>

<!-- 弹窗 -->
<script th:src="@{/static/admin/assets/js/layer/layer.js}" type="text/javascript"></script>
<!-- 遮罩层 -->
<script th:src="@{/static/admin/assets/js/blockUI/jquery.blockUI.js}" type="text/javascript"></script>

<script type="text/javascript">

    var dataUrl = window.rootPath + "/pay/update/list";
    var options = {
        dataUrl: dataUrl,
        sortName: "roleSort",
        modalName: "用户",
        strictSearch: true,
        search: false,
        searchText: "money",
        dataColumns: [
            {
                checkbox: true
            }, {
                field: 'id',
                title: '序号'
            }, {
                field: 'serialNumber',
                title: '账户类型+账户编号'
            }, {
                field: 'payType',
                title: '支付类型'
            }, {
                field: 'money',
                title: '交易金额'
            }, {
                field: 'createDate',
                title: '创建日期',
                formatter: function (value, row, index) {
                    return timetrans(value);
                }
            }, {
                title: '操作',
                formatter: function (value, row, index) {
                    var id = row.id;
                    var actions = [];
                    actions.push('<a class="btn btn-success btn-xs"  href="#" onclick="updateStatus(\'' + row.money + '\')"><i class="fa fa-edit"></i>确认支付</a> ');
                    return actions.join('');
                }
            }]
    };
    $(function () {
        var oTab = $.table.oTableInit(options);
        oTab.Init();

        $(".fixed-table-toolbar").hide();
    });
    
    function updateStatus(money) {
        $.ajax({
            cache: true,
            type: "get",
            url: rootPath + "/pay/update/" + money,
            async: false,
            error: function (request) {
                $.modal.alertError("系统错误");
            },
            success: function (data) {
                $.operate.saveSuccess(data);
            }
        });
    }


    function timetrans(date){
        var date = new Date(date);
        var Y = date.getFullYear() + '-';
        var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1) + '-';
        var D = (date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()) + ' ';
        var h = (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':';
        var m = (date.getMinutes() <10 ? '0' + date.getMinutes() : date.getMinutes()) + ':';
        var s = (date.getSeconds() <10 ? '0' + date.getSeconds() : date.getSeconds());
        return Y+M+D+h+m+s;
    }
</script>


</body>

</html>
